﻿using System;
using System.IO;
using System.Xml.Serialization;

namespace MediaPlayer.Model
{
    [Serializable]
	public class Song
    {
        #region Fields
        private string name;
        private string[] albumArtist;
        private string album;
        #endregion
        #region Properties
        public string FullPath
        {
            get;
            set;
        }
        
        [XmlIgnore]
        public string FileName
        {
            get
            {
               FileInfo fileInfo = new FileInfo(this.FullPath);
               return fileInfo.Name;
            }
        }

        public string Name
        {
            get
            {
                return this.name;
            }
            set
            {
                if (value == null)
                    this.name = "";
                else
                    this.name = value;
            }
        }

        public string[] AlbumArtist
        {
            get
            {
                return this.albumArtist;
            }
            set
            {
                if (value == null)
                    this.albumArtist = new string[1];
                else
                    this.albumArtist = value;
            }
        }

        public string Album
        {
            get
            {
                return this.album;
            }
            set
            {
                if (value == null)
                    this.album = "";
                else
                    this.album = value;
            }
        }
        #endregion
    }
}
